{extend name="index_base" /}
      {block name="seo"}
        <title>登录|{$site_config['site_title']}|{$site_config['seo_title']}</title>
  
  
  <meta name="keywords" content="{$site_config['seo_keyword']}">
  <meta name="description" content="{$site_config['seo_description']}">
      {/block}

{block name="body"}

  <div class="fly-panel fly-panel-user" pad20>
    <div class="layui-tab layui-tab-brief">
      <ul class="layui-tab-title">
        <li class="layui-this">登入</li>
        <li><a href="{:url('login/reg')}">注册</a></li>
      </ul>
      <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
          <div class="layui-form layui-form-pane">
            <form method="post">
              <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">邮箱</label>
                <div class="layui-input-inline">
                  <input type="text" id="L_email" name="email" required lay-verify="required|email|emailss" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label for="L_pass" class="layui-form-label">密码</label>
                <div class="layui-input-inline">
                  <input type="password" id="L_pass" name="pass" required lay-verify="required|pass" autocomplete="off" class="layui-input">
                </div>
              </div>
                {if condition="$loginyzm eq 1"}
              <div class="layui-form-item">
                <label for="L_vercode" class="layui-form-label">验证码</label>
                <div class="layui-input-inline">
                  <input type="text" id="L_vercode" name="code" required lay-verify="required" placeholder="请填写验证码" autocomplete="off" class="layui-input">
                </div>
               <div class="" style="float: left;">
                  <img src="{:url('index/captcha')}" onclick="this.src='{:url('index/captcha')}?'+Math.random();" style="float:left; cursor:pointer;" id="captcha" alt="captcha" />
                </div>
              </div>
              {/if}
              <div class="layui-form-item">
                <button class="layui-btn" lay-filter="login_index" lay-submit>立即登录</button>
                <span style="padding-left:20px;">
                  <a href="{:url("login/forget")}">忘记密码？</a>
                </span>
              </div>
            {:hook('login')}
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
{/block}
{block name="script"}
<script>
layui.use('form',function(){
  var form = layui.form()
  ,jq = layui.jquery;

  form.verify({
  emailss: function(value){
      if(value.length > 32){
        return '邮箱必须小于32位';
      }
    }
    ,pass: [/(.+){6,12}$/, '密码必须6到12位']
    ,content: function(value){
      layedit.sync(editIndex);
    }
  });

  form.on('submit(login_index)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("index/login")}',param,function(data){
      if(data.code == 200){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.href = '{:url("index/index")}';
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
       jq('#captcha').attr('src',"{:url('index/captcha')}?"+Math.random());
      }
    });
    return false;
  });

})
</script>{/block}